clear all

*********Set working directory and load data
local user: env USERNAME
if "`user'" == "ENTERYOURNAME"  cd "SETYOURDIRECTORY"
else if "`user'" == "sagomm"  cd "C:\Users\sagomm\Dropbox\SEP-Trust\Analysis\" 

use "Data\w9_conjoint.dta"

******Install necesarry user-written commands
do "Scripts\functions\function_conjoint.do"
do "Scripts\functions\function_addplot.do"


*** H4a:  When more actors are included in the policy design process, citizens' trust in an individual actor becomes less relevant for their level of policy support. 


**************
*LABELS
**************
label variable trust_inst "Trust in pol. institutions"
label variable trust_univ "Trust in universities"
label variable trust_industry "Trust in industry"
label variable trust_ngo "Trust in NGOs"

************ Trust in institutions *******
reg binary ///
	ib1.actor##c.trust_inst ///
	regulation monitoring sanction reporting year, cluster(PubId)
	
eststo int_1

//Interaction with sector and parliament is significantly different from parliament only 
//Interaction with all actors is not significantly different from parliament only

*********** Trust in universities *******
reg binary ///
	ib2.actor##c.trust_univ ///
	regulation monitoring sanction reporting year, cluster(PubId)
eststo int_2
//Interaction with multiple actors is not significantly different from experts only

************ Trust in NGOs *******
reg binary ///
	ib3.actor##c.trust_ngo ///
	regulation monitoring sanction reporting year, cluster(PubId)
eststo int_3
	//Interaction with multiple actors is significantly different from NGOs only

************ Trust in Industry *******
reg binary ///
	ib4.actor##c.trust_industry ///
	regulation monitoring sanction reporting year, cluster(PubId)
eststo int_4	
//Interaction with multiple actors is significantly different from sector only


// TABLES
esttab int_1 int_2 int_3 int_4 using "H4a_interactions_Appendix.tex", replace order(*#c.trust_* trust_* regulation monitoring sanction reporting year) label se star(+ 0.1 * 0.05 ** 0.01) noomitted nobase mtitles("Trust in pol. institutions" "Trust in universities" "Trust in NGOs" "Trust in industry") stats(N N_clust) wide

esttab int_1 int_2 int_3 int_4 using "H4a_interactions_Main.tex", replace order(*#c.trust_* trust_*) label se star(+ 0.1 * 0.05 ** 0.01) noomitted nobase mtitles("Trust in pol. institutions" "Trust in universities" "Trust in NGOs" "Trust in industry") ///
keep(7.actor#c.trust_inst 7.actor#c.trust_univ 7.actor#c.trust_ngo 7.actor#c.trust_industry)



*** H4b: The level of policy support is higher for broad actor coalitions across all levels of trust, even at its lowest levels.


************ Trust in institutions *******
qui reg binary ///
	ib1.actor##c.trust_inst ///
	regulation monitoring sanction reporting year, cluster(PubId)

mtable, at(trust_inst=(-2(1)2) actor=(1(1)7)) post statistics(all) dec(2)
eststo margins_table1 

qui reg binary ///
	ib1.actor##c.trust_inst ///
	regulation monitoring sanction reporting year, cluster(PubId)
margins, at(trust_inst=(-2(1)2) actor=(1(1)7)) post


  
*Difference low level of trust for broad actor coaltion and high level of trust for single actor
test 31._at - 5._at = 0  // Actor = 7 at -2, and Actor = 1 at 2  (7 = all actors) - significant
test 21._at - 5._at = 0  // Actor = 5 at -2, and Actor = 1 at 2  (5 = parliament and sector) - significant

*********** Trust in universities *******
qui reg binary ///
	ib1.actor##c.trust_univ ///
	regulation monitoring sanction reporting year, cluster(PubId)

mtable, at(trust_univ=(-2(1)2) actor=(1(1)7)) post statistics(all) dec(2)
eststo margins_table2

qui reg binary ///
	ib1.actor##c.trust_univ ///
	regulation monitoring sanction reporting year, cluster(PubId)
margins, at(trust_univ=(-2(1)2) actor=(1(1)7)) post

*Difference low level of trust for broad actor coaltion and high level of trust for single actor
test 31._at - 10._at = 0  // Actor = 7 at -2, and Actor = 2 at 2 - not significant
test 32._at - 10._at = 0  // Actor = 7 at -1, and Actor = 2 at 2 - significant

test 26._at - 10._at = 0  // Actor = 6 at -2, and Actor = 2 at 2  - not significant
test 27._at - 10._at = 0  // Actor = 6 at -2, and Actor = 2 at 2  - significant


************ Trust in NGOs *******
qui reg binary ///
	ib1.actor##c.trust_ngo ///
	regulation monitoring sanction reporting year, cluster(PubId)

mtable, at(trust_ngo=(-2(1)2) actor=(1(1)7)) post statistics(all) dec(2)
eststo margins_table3 

qui reg binary ///
	ib1.actor##c.trust_ngo ///
	regulation monitoring sanction reporting year, cluster(PubId)
margins, at(trust_ngo=(-2(1)2) actor=(1(1)7)) post

*Difference at high and low level of trust for broad actor coaltion
test 31._at - 15._at = 0  // Actor = 7 at -2, and Actor = 3 at 2   - not significant	
test 32._at - 15._at = 0  // Actor = 7 at -1, and Actor = 3 at 2   - significant	

test 26._at - 15._at = 0  // Actor = 6 at -2, and Actor = 3 at 2   - significant	
test 27._at - 15._at = 0  // Actor = 6 at -1, and Actor = 3 at 2   - significant


************ Trust in Industry *******
qui reg binary ///
	ib1.actor##c.trust_industry ///
	regulation monitoring sanction reporting year, cluster(PubId)

mtable, at(trust_industry=(-2(1)2) actor=(1(1)7)) post statistics(all) dec(2)
eststo margins_table4

qui reg binary ///
	ib1.actor##c.trust_industry ///
	regulation monitoring sanction reporting year, cluster(PubId)	
margins, at(trust_industry=(-2(1)2) actor=(1(1)7)) post

*Difference at high and low level of trust for broad actor coaltion
test 31._at - 20._at = 0  // Actor = 7 at -2, and Actor = 4 at 2    - significant	

test 26._at - 20._at = 0  // Actor = 6 at -2, and Actor = 4 at 2     - significant		

test 21._at - 20._at = 0  // Actor = 5 at -2, and Actor = 4 at 2     - significant		



//TABLES
esttab margins_table1 margins_table2 margins_table3 margins_table4 using "mm_H4b_main.tex", replace b ci mtitles("Pol. institutions" "Universities" "NGOs" "Industry") keep(31._at 32._at 5._at 10._at 15._at 20._at) coeflabels(31._at "Low trust (-2SD) * all actors" 32._at "Low trust (-1SD) * all actors" 5._at "High trust (+2SD) * parliament" 10._at "High trust (+2SD) * experts" 15._at "High trust (+2SD) * NGOs"  20._at "High trust (+2SD) * industry" ) title("Marginal mean estimates for actor combinations at different levels of trust in...") nostar 

esttab margins_table1 margins_table2 margins_table3 margins_table4 using "mm_H4b_Appendix.tex", replace b ci mtitles("Pol. institutions" "Universities" "NGOs" "Industry") ///
coeflabels( ///
1._at "Low trust (-2SD) * parliament" ///
2._at "Low trust (-1SD) * parliament" ///
3._at "Mean trust * parliament" ///
4._at "High trust (+1SD) * parliament" ///
5._at "High trust (+2SD) * parliament" ///
6._at "Low trust (-2SD) * experts" ///
7._at "Low trust (-1SD) * experts" ///
8._at "Mean trust * experts" ///
9._at "High trust (+1SD) * experts" ///
10._at "High trust (+2SD) * experts"  ///
11._at "Low trust (-2SD) * NGOs" ///
12._at "Low trust (-1SD) * NGOs" ///
13._at "Mean trust * NGOs" ///
14._at "High trust (+1SD) * NGOs" ///
15._at "High trust (+2SD) * NGOs"   ///
16._at "Low trust (-2SD) * industry" ///
17._at "Low trust (-1SD) * industry" ///
18._at "Mean trust * industry" ///
19._at "High trust (+1SD) * industry" ///
20._at "High trust (+2SD) * industry" ///
21._at "Low trust (-2SD) * Sector and Parl." ///
22._at "Low trust (-1SD) * Sector and Parl." ///
23._at "Mean trust * Sector and Parl." ///
24._at "High trust (+1SD) * Sector and Parl." ///
25._at "High trust (+2SD) * Sector and Parl." ///
26._at "Low trust (-2SD) * Sector, NGOs, Exp." ///
27._at "Low trust (-1SD) * Sector, NGOs, Exp." ///
28._at "Mean trust * Sector, NGOs, Exp." ///
29._at "High trust (+1SD) * Sector, NGOs, Exp." ///
30._at "High trust (+2SD) * Sector, NGOs, Exp." ///
31._at "Low trust (-2SD) * all actors"  ///
32._at "Low trust (-1SD) * all actors" ///
33._at "Mean trust * all actors" ///
34._at "High trust (+1SD) * all actors" ///
35._at "High trust (+2SD) * all actors") ///
title("Marginal mean estimates for actor combinations at different levels of trust in...") nostar wide